Split TPO into two different formats since they have different capabilities.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 17 May 2006 23:18:44 +0000 (23:18 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 17 May 2006 23:18:44 +0000 (23:18 +0000)
gpsbabel/testo
gpsbabel/tpo.c
gpsbabel/vecs.c

index 494da7cc0dffd84179ff741088811e94fbf1820f..1f4601772493ccb9737e7d632a727945e245239c 100755 (executable)
@@ -216,15 +216,15 @@ compare ${TMPDIR}/tpg.mxf ${TMPDIR}/topo.mxf
 #
 # Version 2.x tests
 rm -f ${TMPDIR}/tpo-sample1.gpx ${TMPDIR}/tpo-sample2.tpo
-${PNAME} -t -i tpo -f reference/track/tpo-sample1.tpo -o gpx -F ${TMPDIR}/tpo-sample1.gpx
+${PNAME} -t -i tpo2 -f reference/track/tpo-sample1.tpo -o gpx -F ${TMPDIR}/tpo-sample1.gpx
 compare ${TMPDIR}/tpo-sample1.gpx reference/track/tpo-sample1.gpx
-#${PNAME} -t -i gpx -f reference/track/tpo-sample2.gpx -o tpo -F ${TMPDIR}/tpo-sample2.tpo
+#${PNAME} -t -i gpx -f reference/track/tpo-sample2.gpx -o tpo2 -F ${TMPDIR}/tpo-sample2.tpo
 #bincompare ${TMPDIR}/tpo-sample2.tpo reference/track/tpo-sample2.tpo
 #
 # Version 3.x tests.  Remove the timestamp from the generated file
 # so that the compare will succeed.
 rm -f ${TMPDIR}/tpo-sample3.gpx ${TMPDIR}/tpo-sample3.gpx2
-${PNAME} -t -r -w -i tpo -f reference/tpo-sample3.tpo -o gpx -F ${TMPDIR}/tpo-sample3.gpx
+${PNAME} -t -r -w -i tpo3 -f reference/tpo-sample3.tpo -o gpx -F ${TMPDIR}/tpo-sample3.gpx
 # Remove the timestamp
 grep -v time <${TMPDIR}/tpo-sample3.gpx >${TMPDIR}/tpo-sample3.gpx2
 compare ${TMPDIR}/tpo-sample3.gpx2 reference/tpo-sample3.gpx
index 91464d80b542b03103b55e39e36292a1deb4f9c5..d1fe86b9d307d161583157f178ecc1a32f2611aa 100644 (file)
 static char *dumpheader = NULL;
 static char *output_state = NULL;
   
+/*
 static
-arglist_t tpo_args[] = {
+arglist_t tpo2_args[] = {
        { "dumpheader", &dumpheader, "Display the file header bytes", 
                "0", ARGTYPE_BOOL, ARG_NOMINMAX} , 
        { "state", &output_state, "State map format to write, default=CA", 
          "CA", ARGTYPE_STRING, ARG_NOMINMAX} , 
        ARG_TERMINATOR
 };
+*/
+//
+// Note that we've disabled the write capabilites for the tpo2
+// format at present.  The "testo" tests were failing on some
+// platforms and there wasn't anyone willing to work on the problem.
+// If this is fixed in the future we can go back to the tpo2_args[]
+// above.
+//
+static
+arglist_t tpo2_args[] = {
+       ARG_TERMINATOR
+};
+
+static
+arglist_t tpo3_args[] = {
+       ARG_TERMINATOR
+};
+
 
 static FILE *tpo_file_in;
 static FILE *tpo_file_out;
@@ -1899,8 +1918,24 @@ tpo_write(void)
        track_disp_all(tpo_track_hdr, tpo_track_tlr, tpo_track_disp);
 }
 
-/* TPO format can read and write tracks only */
-ff_vecs_t tpo_vecs = {
+/* TPO 2.x format can read tracks only */
+ff_vecs_t tpo2_vecs = {
+    ff_type_file,   /* ff_type_internal */
+/*    { ff_cap_none | ff_cap_none, ff_cap_read | ff_cap_write, ff_cap_none | ff_cap_none }, */
+    { ff_cap_none | ff_cap_none, ff_cap_read, ff_cap_none | ff_cap_none },
+       tpo_rd_init,
+       tpo_wr_init,
+       tpo_rd_deinit,
+       tpo_wr_deinit,
+       tpo_read,
+       tpo_write,
+       NULL,
+       tpo2_args,
+       CET_CHARSET_ASCII, 0    /* CET-REVIEW */
+};
+
+/* TPO 3.x format can read waypoints/tracks/routes */
+ff_vecs_t tpo3_vecs = {
     ff_type_file,   /* ff_type_internal */
 /*    { ff_cap_none | ff_cap_none, ff_cap_read | ff_cap_write, ff_cap_none | ff_cap_none }, */
     { ff_cap_none | ff_cap_none, ff_cap_read, ff_cap_none | ff_cap_none },
@@ -1911,6 +1946,7 @@ ff_vecs_t tpo_vecs = {
        tpo_read,
        tpo_write,
        NULL,
-       tpo_args,
+       tpo3_args,
        CET_CHARSET_ASCII, 0    /* CET-REVIEW */
 };
+
index add6fc7b2423bd0880e353b77fabc2ba2d8fad09..72a5fecacbeb1b147b254c18bd56c429c2676326 100644 (file)
@@ -97,7 +97,8 @@ extern ff_vecs_t tiger_vecs;
 extern ff_vecs_t tmpro_vecs;
 extern ff_vecs_t tomtom_vecs;
 extern ff_vecs_t tpg_vecs;
-extern ff_vecs_t tpo_vecs;
+extern ff_vecs_t tpo2_vecs;
+extern ff_vecs_t tpo3_vecs;
 extern ff_vecs_t unicsv_vecs;
 extern ff_vecs_t vcf_vecs;
 extern ff_vecs_t vitosmt_vecs;
@@ -227,9 +228,15 @@ vecs_t vec_list[] = {
                "tpg"
        },
        {
-               &tpo_vecs,
-               "tpo",
-               "National Geographic Topo .tpo",
+               &tpo2_vecs,
+               "tpo2",
+               "National Geographic Topo 2.x .tpo",
+               "tpo"
+       },
+       {
+               &tpo3_vecs,
+               "tpo3",
+               "National Geographic Topo 3.x .tpo",
                "tpo"
        },
        {